//
//@File    :	10.10_stack.h
//@Time    :	2021/08/28 10:05:12
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	class definition for the stack ADT
//

#ifndef STACK_H_
#define STACK_H_

typedef unsigned long Item;

class Stack
{
private:
    enum
    {
        MAX = 10
    };              //constant spacific to class
    Item items[MAX]; //hold stack items
    int top;        //index for top stack item
public:
    Stack();
    bool isempty() const;
    bool isfull() const;
    //push() returns false if stack already is full, true otherwise
    bool push(const Item &item); //add item to stack
    //pop() returns false if stack already is empty,true otherwise
    bool pop(Item &item); //pop top into item
};

#endif // STACK_H_